
// <copyright file="TypeMapping.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The type mapping.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Reflection.CodeSerialization
{
    using System;
    using System.Xml.Serialization;

    /// <summary>
    /// The type mapping.
    /// </summary>
    [Serializable]
    [XmlRoot("Mapping")]
    public sealed class TypeMapping
    {
        #region Constructors and Finalizers

        /// <summary>
        /// Initializes a new instance of the <see cref="TypeMapping"/> class.
        /// </summary>
        public TypeMapping()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TypeMapping"/> class.
        /// </summary>
        /// <param name="serverType">
        /// The server type.
        /// </param>
        /// <param name="clientType">
        /// The client type.
        /// </param>
        public TypeMapping(string serverType, string clientType)
        {
            this.ServerType = serverType;
            this.ClientType = clientType;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TypeMapping"/> class.
        /// </summary>
        /// <param name="serverType">
        /// The server type.
        /// </param>
        /// <param name="clientType">
        /// The client type.
        /// </param>
        /// <param name="serverMethodName">
        /// The server method name.
        /// </param>
        public TypeMapping(string serverType, string clientType, string serverMethodName)
            : this(serverType, clientType)
        {
            this.ServerMethodName = serverMethodName;
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets or sets the client type.
        /// </summary>
        [XmlAttribute]
        public string ClientType { get; set; }

        /// <summary>
        /// Gets or sets the server method name.
        /// </summary>
        [XmlAttribute]
        public string ServerMethodName { get; set; }

        /// <summary>
        /// Gets or sets the server type.
        /// </summary>
        [XmlAttribute]
        public string ServerType { get; set; }

        #endregion Public Properties
    }
}
